package com.wcar.common.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.models.auth.In;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 
 * @TableName tb_product
 */
@TableName(value ="tb_product")
@Data
public class Product implements Serializable {
    /**
     * 主键自增
     */
    @TableId(type = IdType.AUTO)
    private Integer productId;

    /**
     * 商品类型id
     */
    private Integer proTypeId;

    /**
     * 商品名称
     */
    private String productName;

    /**
     * 商品封面图片
     */
    private String picture;

    /**
     * 积分
     */
    private Integer integral;

    /**
     * 是否启用积分（0 启用 1 不启用）
     */
    private String integralEnabled;

    /**
     * 原价
     */
    private Integer loadPrice;

    /**
     * 现价
     */
    private BigDecimal newPrice;

    /**
     * 优惠金额
     */
    private Integer couponAmount;

    /**
     * 月销售量
     */
    private Long monthlySales;

    /**
     * 优惠券id 关联优惠码表（如果为空 就是普通商品）
     */
    private Integer couponId;

    /**
     * 运费是否包邮（0 包邮 1 不包邮 ）
     */
    private String isFreightShipping;

    /**
     * 运费(元)
     */
    private BigDecimal freight;

    /**
     * 门店id
     */
    private Integer storeId;

    /**
     * 是否上线(0,1)
     */
    private String isline;

    /**
     * 温馨提示
     */
    private String prompt;

    /**
     * 商品详情
     */
    private String productDetails;

    /**
     * 创建人
     */
    private Integer createId;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /**
     * 更新人
     */
    private Integer updateId;

    /**
     * 备注
     */
    private String remark;

    /**
     * 审核状态（0 待审核 1 审核通过 2 审核未通过）
     */
    private String examineStatus;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private String name;

    @TableField(exist = false)
    private String storeName;
    @TableField(exist = false)
    private String userName;
    @TableField(exist = false)
    private String updateName;
    @TableField(exist = false)
    private BigDecimal totalAmount;
    @TableField(exist = false)
    private Integer productCount;
    /**
     * 主键自增
     */
    public Integer getProductId() {
        return productId;
    }

    /**
     * 主键自增
     */
    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    /**
     * 商品类型id
     */
    public Integer getProTypeId() {
        return proTypeId;
    }

    /**
     * 商品类型id
     */
    public void setProTypeId(Integer proTypeId) {
        this.proTypeId = proTypeId;
    }

    /**
     * 商品名称
     */
    public String getProductName() {
        return productName;
    }

    /**
     * 商品名称
     */
    public void setProductName(String productName) {
        this.productName = productName;
    }

    /**
     * 商品封面图片
     */
    public String getPicture() {
        return picture;
    }

    /**
     * 商品封面图片
     */
    public void setPicture(String picture) {
        this.picture = picture;
    }

    /**
     * 积分
     */
    public Integer getIntegral() {
        return integral;
    }

    /**
     * 积分
     */
    public void setIntegral(Integer integral) {
        this.integral = integral;
    }

    /**
     * 是否启用积分（0 启用 1 不启用）
     */
    public String getIntegralEnabled() {
        return integralEnabled;
    }

    /**
     * 是否启用积分（0 启用 1 不启用）
     */
    public void setIntegralEnabled(String integralEnabled) {
        this.integralEnabled = integralEnabled;
    }

    /**
     * 原价
     */
    public Integer getLoadPrice() {
        return loadPrice;
    }

    /**
     * 原价
     */
    public void setLoadPrice(Integer loadPrice) {
        this.loadPrice = loadPrice;
    }

    /**
     * 现价
     */
    public BigDecimal getNewPrice() {
        return newPrice;
    }

    /**
     * 现价
     */
    public void setNewPrice(BigDecimal newPrice) {
        this.newPrice = newPrice;
    }

    /**
     * 优惠金额
     */
    public Integer getCouponAmount() {
        return couponAmount;
    }

    /**
     * 优惠金额
     */
    public void setCouponAmount(Integer couponAmount) {
        this.couponAmount = couponAmount;
    }

    /**
     * 月销售量
     */
    public Long getMonthlySales() {
        return monthlySales;
    }

    /**
     * 月销售量
     */
    public void setMonthlySales(Long monthlySales) {
        this.monthlySales = monthlySales;
    }

    /**
     * 优惠券id 关联优惠码表（如果为空 就是普通商品）
     */
    public Integer getCouponId() {
        return couponId;
    }

    /**
     * 优惠券id 关联优惠码表（如果为空 就是普通商品）
     */
    public void setCouponId(Integer couponId) {
        this.couponId = couponId;
    }

    /**
     * 运费是否包邮（0 包邮 1 不包邮 ）
     */
    public String getIsFreightShipping() {
        return isFreightShipping;
    }

    /**
     * 运费是否包邮（0 包邮 1 不包邮 ）
     */
    public void setIsFreightShipping(String isFreightShipping) {
        this.isFreightShipping = isFreightShipping;
    }

    /**
     * 运费(元)
     */
    public BigDecimal getFreight() {
        return freight;
    }

    /**
     * 运费(元)
     */
    public void setFreight(BigDecimal freight) {
        this.freight = freight;
    }

    /**
     * 门店id
     */
    public Integer getStoreId() {
        return storeId;
    }

    /**
     * 门店id
     */
    public void setStoreId(Integer storeId) {
        this.storeId = storeId;
    }

    /**
     * 是否上线(0,1)
     */
    public String getIsline() {
        return isline;
    }

    /**
     * 是否上线(0,1)
     */
    public void setIsline(String isline) {
        this.isline = isline;
    }

    /**
     * 温馨提示
     */
    public String getPrompt() {
        return prompt;
    }

    /**
     * 温馨提示
     */
    public void setPrompt(String prompt) {
        this.prompt = prompt;
    }

    /**
     * 商品详情
     */
    public String getProductDetails() {
        return productDetails;
    }

    /**
     * 商品详情
     */
    public void setProductDetails(String productDetails) {
        this.productDetails = productDetails;
    }

    /**
     * 创建人
     */
    public Integer getCreateId() {
        return createId;
    }

    /**
     * 创建人
     */
    public void setCreateId(Integer createId) {
        this.createId = createId;
    }

    /**
     * 创建时间
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 创建时间
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * 更新时间
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * 更新时间
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    /**
     * 更新人
     */
    public Integer getUpdateId() {
        return updateId;
    }

    /**
     * 更新人
     */
    public void setUpdateId(Integer updateId) {
        this.updateId = updateId;
    }

    /**
     * 备注
     */
    public String getRemark() {
        return remark;
    }

    /**
     * 备注
     */
    public void setRemark(String remark) {
        this.remark = remark;
    }

    /**
     * 审核状态（0 待审核 1 审核通过 2 审核未通过）
     */
    public String getExamineStatus() {
        return examineStatus;
    }

    /**
     * 审核状态（0 待审核 1 审核通过 2 审核未通过）
     */
    public void setExamineStatus(String examineStatus) {
        this.examineStatus = examineStatus;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Product other = (Product) that;
        return (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId()))
            && (this.getProTypeId() == null ? other.getProTypeId() == null : this.getProTypeId().equals(other.getProTypeId()))
            && (this.getProductName() == null ? other.getProductName() == null : this.getProductName().equals(other.getProductName()))
            && (this.getPicture() == null ? other.getPicture() == null : this.getPicture().equals(other.getPicture()))
            && (this.getIntegral() == null ? other.getIntegral() == null : this.getIntegral().equals(other.getIntegral()))
            && (this.getIntegralEnabled() == null ? other.getIntegralEnabled() == null : this.getIntegralEnabled().equals(other.getIntegralEnabled()))
            && (this.getLoadPrice() == null ? other.getLoadPrice() == null : this.getLoadPrice().equals(other.getLoadPrice()))
            && (this.getNewPrice() == null ? other.getNewPrice() == null : this.getNewPrice().equals(other.getNewPrice()))
            && (this.getCouponAmount() == null ? other.getCouponAmount() == null : this.getCouponAmount().equals(other.getCouponAmount()))
            && (this.getMonthlySales() == null ? other.getMonthlySales() == null : this.getMonthlySales().equals(other.getMonthlySales()))
            && (this.getCouponId() == null ? other.getCouponId() == null : this.getCouponId().equals(other.getCouponId()))
            && (this.getIsFreightShipping() == null ? other.getIsFreightShipping() == null : this.getIsFreightShipping().equals(other.getIsFreightShipping()))
            && (this.getFreight() == null ? other.getFreight() == null : this.getFreight().equals(other.getFreight()))
            && (this.getStoreId() == null ? other.getStoreId() == null : this.getStoreId().equals(other.getStoreId()))
            && (this.getIsline() == null ? other.getIsline() == null : this.getIsline().equals(other.getIsline()))
            && (this.getPrompt() == null ? other.getPrompt() == null : this.getPrompt().equals(other.getPrompt()))
            && (this.getProductDetails() == null ? other.getProductDetails() == null : this.getProductDetails().equals(other.getProductDetails()))
            && (this.getCreateId() == null ? other.getCreateId() == null : this.getCreateId().equals(other.getCreateId()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getUpdateId() == null ? other.getUpdateId() == null : this.getUpdateId().equals(other.getUpdateId()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getExamineStatus() == null ? other.getExamineStatus() == null : this.getExamineStatus().equals(other.getExamineStatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode());
        result = prime * result + ((getProTypeId() == null) ? 0 : getProTypeId().hashCode());
        result = prime * result + ((getProductName() == null) ? 0 : getProductName().hashCode());
        result = prime * result + ((getPicture() == null) ? 0 : getPicture().hashCode());
        result = prime * result + ((getIntegral() == null) ? 0 : getIntegral().hashCode());
        result = prime * result + ((getIntegralEnabled() == null) ? 0 : getIntegralEnabled().hashCode());
        result = prime * result + ((getLoadPrice() == null) ? 0 : getLoadPrice().hashCode());
        result = prime * result + ((getNewPrice() == null) ? 0 : getNewPrice().hashCode());
        result = prime * result + ((getCouponAmount() == null) ? 0 : getCouponAmount().hashCode());
        result = prime * result + ((getMonthlySales() == null) ? 0 : getMonthlySales().hashCode());
        result = prime * result + ((getCouponId() == null) ? 0 : getCouponId().hashCode());
        result = prime * result + ((getIsFreightShipping() == null) ? 0 : getIsFreightShipping().hashCode());
        result = prime * result + ((getFreight() == null) ? 0 : getFreight().hashCode());
        result = prime * result + ((getStoreId() == null) ? 0 : getStoreId().hashCode());
        result = prime * result + ((getIsline() == null) ? 0 : getIsline().hashCode());
        result = prime * result + ((getPrompt() == null) ? 0 : getPrompt().hashCode());
        result = prime * result + ((getProductDetails() == null) ? 0 : getProductDetails().hashCode());
        result = prime * result + ((getCreateId() == null) ? 0 : getCreateId().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getUpdateId() == null) ? 0 : getUpdateId().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getExamineStatus() == null) ? 0 : getExamineStatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", productId=").append(productId);
        sb.append(", proTypeId=").append(proTypeId);
        sb.append(", productName=").append(productName);
        sb.append(", picture=").append(picture);
        sb.append(", integral=").append(integral);
        sb.append(", integralEnabled=").append(integralEnabled);
        sb.append(", loadPrice=").append(loadPrice);
        sb.append(", newPrice=").append(newPrice);
        sb.append(", couponAmount=").append(couponAmount);
        sb.append(", monthlySales=").append(monthlySales);
        sb.append(", couponId=").append(couponId);
        sb.append(", isFreightShipping=").append(isFreightShipping);
        sb.append(", freight=").append(freight);
        sb.append(", storeId=").append(storeId);
        sb.append(", isline=").append(isline);
        sb.append(", prompt=").append(prompt);
        sb.append(", productDetails=").append(productDetails);
        sb.append(", createId=").append(createId);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", updateId=").append(updateId);
        sb.append(", remark=").append(remark);
        sb.append(", examineStatus=").append(examineStatus);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}